<template>
  <div>
    A组件
    <input type="text" v-model="number">
  </div>
</template>
<script setup name="A">
const number = ref(1);

onActivated(() => {
  console.log('A组件被激活了');
});

onDeactivated(() => {
  console.log('A组件被停用了');
});
</script>